$OpenBSD: patch-common_Makefile_in,v 1.24 2015/04/05 22:25:08 robert Exp $
--- common/Makefile.in.orig	Thu Mar  5 16:52:51 2015
+++ common/Makefile.in	Fri Apr  3 23:11:10 2015
@@ -432,7 +432,7 @@ AM_CPPFLAGS = ${ZCPPFLAGS} $(DEBUGFLAGS) $(BOOST_CPPFL
 	-I${top_srcdir}/mapi4linux/include -I${top_srcdir}/provider/common \
 	-I${top_srcdir}/libfreebusy $(MYSQL_INCLUDES)
 
-libcommon_mapi_la_LDFLAGS = ${AM_LDFLAGS} -static
+libcommon_mapi_la_LDFLAGS = ${AM_LDFLAGS}
 libcommon_mapi_la_SOURCES = CommonUtil.cpp  \
 			rtfutil.cpp					    \
 			codepage.cpp					\
@@ -456,8 +456,9 @@ libcommon_mapi_la_SOURCES = CommonUtil.cpp  \
 			MAPIConsoleTable.cpp			\
 			ECMAPIDebug.cpp					\
 			MAPIErrors.cpp
+libcommon_mapi_la_LIBADD = -lpthread ${ICU_LIBS}
 
-libcommon_util_la_LDFLAGS = ${AM_LDFLAGS} -static
+libcommon_util_la_LDFLAGS = ${AM_LDFLAGS}
 libcommon_util_la_SOURCES = platform.cpp platform.linux.cpp md5.cpp \
 	base64.cpp ECLogger.cpp ECConfig.cpp ECConfigImpl.cpp \
 	ECFifoBuffer.cpp ECSerializer.cpp ECCache.cpp my_getopt.cpp \
@@ -468,14 +469,17 @@ libcommon_util_la_SOURCES = platform.cpp platform.linu
 	ECGetText.cpp threadutil.cpp ECRestriction.cpp userutil.cpp \
 	ECFeatures.cpp ECACL.cpp fileutil.cpp ECThreadPool.cpp \
 	ConsoleTable.cpp $(am__append_1)
-libcommon_ssl_la_LDFLAGS = ${AM_LDFLAGS} -static
+libcommon_util_la_LIBADD = -lpthread ${BOOST_FILESYSTEM_LIBS} ${BOOST_SYSTEM_LIBS} ${ICU_LIBS}
+libcommon_ssl_la_LDFLAGS = ${AM_LDFLAGS}
 libcommon_ssl_la_SOURCES = \
 			SSLUtil.cpp								\
 			ECChannelClient.cpp						\
 			ECChannel.cpp
+libcommon_ssl_la_LIBADD = -lpthread ${SSL_LIBS}
 
-libcommon_service_la_LDFLAGS = ${AM_LDFLAGS} -static
+libcommon_service_la_LDFLAGS = ${AM_LDFLAGS}
 libcommon_service_la_SOURCES = ECDatabaseMySQL.cpp
+libcommon_service_la_LIBADD = ${MYSQL_LIBS}
 all: config.h
 	$(MAKE) $(AM_MAKEFLAGS) all-am
 
